//
//  DoctorClassroomCell.swift
//  FiveProvincesOfNorthChina
//
//  Created by kys-20 on 2019/9/14.
//  Copyright © 2019 kys-20. All rights reserved.
//

import UIKit
import SnapKit
class DoctorClassroomCell: UICollectionViewCell {
    

    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUpUI()
        
    }
    
    lazy var imgView : UIImageView = {
        let img = UIImageView()
        img.backgroundColor = grayColor
     
        return img
    }()
    
    lazy var label : UILabel = {
        let lab = UILabel()
        lab.textAlignment = .center
        lab.numberOfLines = 0
        lab.font = UIFont.systemFont(ofSize: 13)
        lab.textColor = UIColor.black
        return lab
    }()

    
    private func setUpUI(){
        self.addSubview(imgView)
        self.addSubview(label)
        imgView.snp.makeConstraints { (make) in
            make.top.equalTo(self)
            make.right.left.equalTo(self)
            make.width.equalTo(self.snp.width)
            let wi = self.frame.width
            make.height.equalTo(wi*(3/5))
        }
        label.snp.makeConstraints { (make) in
            make.top.equalTo(imgView.snp.bottom)
            make.right.left.equalTo(self)
            make.width.equalTo(self)
            make.bottom.equalTo(self)
        }
    }
    
    func setData(img:UIImage,labelStr:String){
        imgView.image = img
        label.text = labelStr
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
  
}


